<%--
 * (c)2010-2011 Andrea Caltroni (andrea.caltroni@pd.infn.it), INFN (www.infn.it)
 *
 * This file is part of the IGI Survey Portlet (from here on shortened to IGISP).
 * IGISP is free software: you can redistribute it and/or modify it 
 * under the terms of the GNU General Public License as published by the Free 
 * Software Foundation, either version 3 of the License, or (at your option) any 
 * later version.
 *
 * IGISP is distributed in the hope that it will be useful, but WITHOUT ANY 
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
 * A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with IGISP. If not, see <http://www.gnu.org/licenses/>.
 *
--%>

<%@ include file="./init.jsp" %>

<h3><spring:message code="report.export.title"/></h3>

<div class="portlet-body">

	<portlet:resourceURL var="resourceUrl">
		<portlet:param name="action" value="downloadFile"/>
	</portlet:resourceURL>

	<form:form name="exportReportForm" commandName="exportReportCommand" method="post" action="${resourceUrl}">
        
        <form:hidden path="survey" />
        
		<table class="lfr-table">
            <tr>
                <th><spring:message code="report.label.format"/></th>
                <th><spring:message code="report.label.type"/></th>
            </tr>
            
            <tr>
                <td>
            <c:forEach items="${formatValues}" var="formatValue">
                <form:radiobutton path="reportFormat" value="${formatValue}"/> ${formatValue}<br />
            </c:forEach>
                </td>
                <td>
                
            <c:forEach items="${typeValues}" var="typeValue">
                <form:radiobutton path="reportType" value="${typeValue}"/> ${typeValue}<br />
            </c:forEach>
                </td>
            </tr>
            <tr>
                <td><form:errors cssClass="portlet-msg-error" path="reportFormat" /></td>
                <td><form:errors cssClass="portlet-msg-error" path="reportType" /></td>
            </tr>
            
            <%--            
            <tr>
                <td><form:radiobuttons path="reportFormat" items="${formatValues}"/>
                <form:errors cssClass="portlet-msg-error" path="reportFormat" /></td>
                <td><form:radiobuttons path="reportType" items="${typeValues}"/>
                <form:errors cssClass="portlet-msg-error" path="reportType" /></td>
            </tr>
             --%>
        </table>

        <div class="lfr-separator">&nbsp;</div>
    
        <div class="lfr-toolbar">
            <!-- <button type="submit"><spring:message code="button.export"/></button> -->
            <!-- <a href="#" onClick="window.location ='${resourceUrl}';"> Download survey </a> -->
            <!-- <input type="button" value="Submit" onClick="location.href = '<portlet:resourceURL><portlet:param name="reportType" value="pdf" /></portlet:resourceURL>'" /> -->
            <a href="<portlet:resourceURL id="downloadFile" escapeXml="false" />">Download survey</a><br/>
        </div>

	</form:form>
</div>

<div class="lfr-separator">&nbsp;</div>

<div class="portlet-section-footer">
    <a href="<portlet:renderURL portletMode="view"/>"><img title="<spring:message code="button.home"/>" src="<html:imagesPath/>home.png" border=0 /></a>
</div>
